home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / tech91.zip / TI783.ASC < prev    next >
Text File  |  1991-08-26  |  7KB  |  199 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.   PRODUCT  :  Paradox                                NUMBER  :  783
  9.   VERSION  :  All
  10.        OS  :  DOS
  11.      DATE  :  August 26, 1991                          PAGE  :  1/3
  12.  
  13.     TITLE  :  What in the World is a Relational Database?
  14.  
  15.  
  16.  
  17.  
  18.   A simple form of database management is called a "flat-file"
  19.   database manager.  A flat-file database is a database containing
  20.   all of its information in one table.  Let's assume you have a
  21.   database of customers and the orders those customers have placed.
  22.   The table you use would look something like this:
  23.  
  24.   ╔═══════════╦════════════╦═══════════════╦═══════════════╦═══════════════╗
  25.   ║ Customer  ║ Address    ║ Telephone #   ║ Part Ordered  ║ Date of Order ║
  26.   ╠═══════════╬════════════╬═══════════════╬═══════════════╬═══════════════╣
  27.   ║John Doe   ║123 Main St.║ (408)555-1212 ║ Backhoe       ║   12/25/89    ║
  28.   ║Bill Smith ║456 Elm St. ║ (408)555-2424 ║ Vacuum Bottle ║   01/04/90    ║
  29.   ║John Doe   ║123 Main St.║ (408)555-1212 ║ Jigsaw Puzzle ║   02/12/90    ║
  30.   ║John Doe   ║123 Main St.║ (408)555-1212 ║ Brahmin Bull  ║   02/14/90    ║
  31.   ║Bill Smith ║456 Elm St. ║ (408)555-2424 ║ Coffee Maker  ║   04/17/90    ║
  32.   ║Bill Smith ║123 Main St.║ (408)555-2424 ║ Antacid (case)║   04/18/90    ║
  33.   ║           ║            ║               ║               ║               ║
  34.   ╚═══════════╩════════════╩═══════════════╩═══════════════╩═══════════════╝
  35.  
  36.   This is certainly more efficient than trying to keep track of all
  37.   your customers on paper.  If you wish, you can sort this table by
  38.   customer or by part or by date, which means you can review your
  39.   sales figures rapidly.  In many flat-file databases you can
  40.   easily create reports based on your table.  Flat-file databases
  41.   managers combine the virtues of power and simplicity.  They are
  42.   powerful enough for many business applications, yet simple enough
  43.   that relatively inexperienced computer users can learn them in
  44.   fairly short order.
  45.  
  46.   The drawback of a flat-file database is that information is often
  47.   repeated.  In the table above, Bill Smith and John Doe each have
  48.   placed three orders.  Instead of letting us enter their name,
  49.   address, and telephone number information once, we must enter ALL
  50.   that information again for EACH order.  Not only does this mean
  51.   we have to do a lot of unnecessary work, but it introduces more
  52.   possibilities for error.
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.   PRODUCT  :  Paradox                                NUMBER  :  783
  75.   VERSION  :  All
  76.        OS  :  DOS
  77.      DATE  :  August 26, 1991                          PAGE  :  2/3
  78.  
  79.     TITLE  :  What in the World is a Relational Database?
  80.  
  81.  
  82.  
  83.  
  84.   A relational database, on the other hand, is designed to
  85.   circumvent these shortcomings.  Relational databases are designed
  86.   to take advantage of the relationships among various groups of
  87.   data.  In this case, the relationship between customers and
  88.   orders looks something like this:
  89.  
  90.   ┌───────────────┐
  91.   │  Bill Smith   │
  92.   └───────┬───────┘
  93.           │     ┌──────────────┐
  94.           ├─────┤Vacuum Bottle │
  95.           │     └──────────────┘
  96.           │     ┌──────────────┐
  97.           ├─────┤Coffee Maker  │
  98.           │     └──────────────┘
  99.           │     ┌──────────────┐
  100.           └─────┤Antacid (case)│
  101.                 └──────────────┘
  102.  
  103.   This sort of relationship is called a "one-to-many" relationship.
  104.   For every ONE customer, there are (if business is going
  105.   reasonably well) MANY orders.  Now a relational database manager
  106.   (such as Borland's Paradox) knows how to capture this relation.
  107.  
  108.   Instead of having ONE table in which all this information is
  109.   contained, the customer-order relation is captured in two tables,
  110.   one of which contains the master information, the other of which
  111.   contains detail information for each master record.  The first
  112.   table, also called the "master" table, has all the basic customer
  113.   information:
  114.  
  115.   CUSTOMER ═══╦═Customer════╦Address══════╦═Telephone #═══╗
  116.               ║ Bill Smith  ║456 Elm St.  ║ (408)555-2424 ║
  117.               ║ John Doe    ║123 Main St. ║ (408)555-1212 ║
  118.  
  119.   You will notice each name appears ONCE in this table; there is no
  120.   duplication of customer records.
  121.  
  122.   The second table, also called a "detail" table, contains the
  123.   order information:
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.   PRODUCT  :  Paradox                                NUMBER  :  783
  141.   VERSION  :  All
  142.        OS  :  DOS
  143.      DATE  :  August 26, 1991                          PAGE  :  3/3
  144.  
  145.     TITLE  :  What in the World is a Relational Database?
  146.  
  147.  
  148.  
  149.  
  150.   ORDERS ════╦═Customer═════╦═Part Ordered ═╦═Date of Order══╗
  151.              ║ Bill Smith   ║ Antacid (case)║ 04/18/90       ║
  152.              ║ Bill Smith   ║ Coffee Maker  ║ 04/17/90       ║
  153.              ║ Bill Smith   ║ Vacuum Bottle ║ 01/04/90       ║
  154.              ║ John Doe     ║ Backhoe       ║ 12/25/89       ║
  155.              ║ John Doe     ║ Brahmin Bull  ║ 02/14/90       ║
  156.              ║ John Doe     ║ Jigsaw Puzzle ║ 02/12/90       ║
  157.  
  158.   Here you will see that each item has a separate line.  Instead of
  159.   repeating all the information for each customer, only the name
  160.   field (which is the field that "links" these two tables) is
  161.   repeated.  This in itself is an advantage; we save a lot of disk
  162.   space, especially as the number of orders per customer increases.
  163.   Often the field that "links" the two tables is a code or id of
  164.   some kind versus a name; this would further save on disk space.
  165.  
  166.   The quick answer is that in a database like Paradox, there is
  167.   seldom need to enter information twice.  You can, with very
  168.   little effort, create "multi-table forms."  Multi-table forms are
  169.   a method of combining two or more tables on one data entry form.
  170.   In Paradox, a multi-table form automatically fills in the linking
  171.   fields in the detail table.  This means several things:
  172.  
  173.            *     Once you have entered a record in the master
  174.                  table, all you have to do for new orders is enter
  175.                  the new order information.  This cuts down on the
  176.                  work data entry people must do, and reduces the
  177.                  tedium of data entry.
  178.  
  179.            *     The possibilities for error are reduced because
  180.                  data entry work is reduced.
  181.  
  182.            *     All the records for any given customer can be
  183.                  viewed on one screen -- without cluttering the
  184.                  screen with duplicate name and address
  185.                  information.
  186.  
  187.   In Paradox 3.0 and up, multi-table forms are discussed in the
  188.   Paradox Presenting Data Guide.
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.